package kotlin05.src.main.java.com.example.kotlin05.s01

import java.lang.reflect.Field

/**
 * 4.扩展属性
 *
 *  像链式调用类似
 *      <T> T.XXX() : T
 *
 */
fun main() {

    "The people's republic of china".numVowels.easyPrint4()
    "The people's republic of china".easyPrint4().numVowels.easyPrint4()


}


//扩展超类方法
fun <T> T.easyPrint4() : T {
    println(this)
    return this

}

val String.numVowels
    get() = count{
        "aeiou".contains(it)
    }
